<!--
 * @Description: 
 * @Author: charles
 * @Date: 2020-11-03 14:05:02
<<<<<<< HEAD
<<<<<<< HEAD
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2021-07-03 16:42:05
-->
<template>
  <div>
    <div class="header">
      <div>
        <a href="/#/home">行学天下</a>
        </div>
      <div>
        <img src="../assets/yxtx/phone.png" alt="图片加载失败">
        联系我们
      </div>
    </div>
    <div class="content"> 
      <div class="title">{{this.article.title}}</div>
      <div class="timeandauthor">
        {{fmtime(this.article.publishTime)}}| {{this.article.baseUser.realname}}
      </div>
      <div class="introduce" v-html="this.article.content">

      </div>
    </div>
    <div class="footer">
      <el-button type="primary" plain @click="goBackHandler">返回</el-button>
    </div>
  </div>
</template>
<script>
import request from '../utils/request'
import moment from 'moment'
export default {
  data(){
    return{
      id:null,
      article:[]
    }
  },
  methods:{
    findArticleById(){
      request.get('/index/article/findById?id='+this.id).then(res=>{
        this.article = res.data;
      })
    },
    fmtime(date){
      return moment(date).format("YYYY-MM-DD")
    },
    goBackHandler(){
      this.$router.go(-1);
    }
  },
  created(){
    this.id = this.$route.query.id
    // console.log(id)
    this.findArticleById(this.id)
  }
}
</script>
<style lang="scss" scoped>
a{
    text-decoration: none;
    color: black;
  }
  .header{
    height: 100px;
    box-shadow: 0px 0px 5px 1px #333;
    display: flex;
  }
  .header div{
    height: 100px;
    width: 200pd;
    line-height: 100px;
    font-size: 100px;
    text-align: center;
  }
  .header div:first-child{
    font-size: 30px;
    flex:1;
  }
  .header div:last-child{
    font-size:24px;
    padding-right: 20px;
    text-align: right;
    flex:4;
  }
  .header img{
    height: 25px;
    width: 25px;

  }
  .content{
    margin: 0px 100px;
  }
  .title{
    height: 30px;
    line-height: 30px;
    font-size: 25px;
    font-weight: 900;
    text-align: center;
    margin-top: 25px;
  }
  .timeandauthor{
    height: 40px;
    line-height: 40px;
    font-size: 18px;
    text-align: center;
  }
  .introduce{
    font-size: 16px;
  }
  .footer{
    margin-top: 20px;
    text-align: center;
  }
</style>
=======
=======
>>>>>>> cb0c2efb683900ed49a96c205c381575bf304d9a
 * @LastEditors: charles
 * @LastEditTime: 2021-06-29 21:59:46
-->
<template>
  <div>
    学生风采
  </div>
<<<<<<< HEAD
</template>
>>>>>>> cb0c2efb683900ed49a96c205c381575bf304d9a
=======
</template>
>>>>>>> cb0c2efb683900ed49a96c205c381575bf304d9a
